<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <!-- <link rel="icon" type="image/svg+xml" href="/vite.svg" /> -->
    <link rel="icon" href="/fruit-tree.png">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vite + Vue + TS</title>
  </head>
  <body>
    <div id="app"></div>
    <script>
      // 设置rem
      let timer = null;

      function setWindow() {
        const docEl = document.documentElement;
        //当前页面的长度
        const HtmlDom = docEl.getBoundingClientRect().width;
        //设置rem
        docEl.style.fontSize = HtmlDom / 100 + "px";
      }

      window.addEventListener("resize", () => {
        // console.log("window resize");
        clearTimeout(timer);
        timer = setTimeout(() => {
          setWindow();
        }, 0);
      });

      setWindow();
    </script>
    <script type="module" src="/src/main.ts"></script>
  </body>
</html>
